
package supply;

import java.io.*;
import java.io.InputStreamReader;

public class Main {

   static int Mainmenu;
   static product pro=new product();
   static inventory inv=new inventory();

   public static void main(String[] args) throws IOException {
   InputStreamReader is1=new InputStreamReader(System.in);
   BufferedReader br1=new BufferedReader(is1);

   //product pro=new product();
   //inventory inv=new inventory();


   System.out.println("Welcome to the Inventory System :");
   System.out.println("___________________________________________________");
   System.out.println("The Product that the Manufacturer could produce are : ");
   System.out.println("0 -> Veg Rice");
   System.out.println("1 -> Veg Noodles");
   System.out.println("2 -> Egg Rice");
   System.out.println("3 -> Egg Noodles");
   System.out.println("4 -> Chicken Rice");
   System.out.println("5 -> Mixed Rice");
   System.out.println("---------------------------------------------------------------");
   System.out.println("All the Above Products should be added in the inventory System");
   System.out.println("---------------------------------------------------------------");
   System.out.println("---------------------------------------");
   System.out.println("Select the number from the Menu Below :");
   System.out.println("---------------------------------------");
   System.out.println("0 -> Add the Products to the Inventory System");
   System.out.println("1 -> Select the Product");
   System.out.println("2 -> Check Initial Items in the Inventory");
   

   Mainmenu=Integer.parseInt(br1.readLine());

   
   if(Mainmenu==1)
   {
        pro.selectProduct();
   }
  else if (Mainmenu==2)
   {
        inv.availableitems();
        starting();
   }
   else if (Mainmenu==0)
   {
       pro.addProduct();
   }

  else
  {
       System.out.println("Please Select the proper number : ");
  }

 }
    public static void starting() throws IOException
    {

    InputStreamReader is2=new InputStreamReader(System.in);
    BufferedReader br2=new BufferedReader(is2);
    System.out.println();
    System.out.println("---------------------------------------");
    System.out.println("Select the number from the Menu Below :");
    System.out.println("---------------------------------------");
    System.out.println("1 -> Select the Product");
    System.out.println("2 -> Check the Inventory");
    System.out.println("3 -> Display the Products that can be Produced");
    System.out.println("Enter Any other number other than the number displayed to close the program");
    Mainmenu=Integer.parseInt(br2.readLine());

    if(Mainmenu==1)
   {
        pro.selectProduct();
   }
  else if (Mainmenu==2)
   {
        inv.availableitems();
   }

    else if (Mainmenu==3)
   {
        pro.displayProducts();
   }

  else
  {
      System.out.println("<--- Thanks for Using the Inventory System --->");

  }

//  else
//  {
//       System.out.println("Please Select the proper number : ");
//       starting();
//  }
    
    }
     

}
